// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')

module.exports = {
  build: {
    env: require('./prod.env'),
    index: path.resolve(__dirname, '../dist/index.html'),
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    productionSourceMap: true,
    // Gzip off by default as many popular static hosts such as
    // Surge or Netlify already gzip all static assets for you.
    // Before setting to `true`, make sure to:
    // npm install --save-dev compression-webpack-plugin
    productionGzip: false,
    productionGzipExtensions: ['js', 'css'],
    // Run the build command with an extra argument to
    // View the bundle analyzer report after build finishes:
    // `npm run build --report`
    // Set to `true` or `false` to always turn it on or off
    bundleAnalyzerReport: process.env.npm_config_report
  },
  dev: {
    env: require('./dev.env'),
    port: 8888,
    autoOpenBrowser: false,
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    proxyTable: {
      '/api/cms/activity/query': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/activity/query': '/api/cms/activity/query'
        }
      },
      '/api/cms/activity/queryHotActivity': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/activity/queryHotActivity': '/api/cms/activity/queryHotActivity'
        }
      },
      '/api/cms/activity/interestGroup/list': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/activity/interestGroup/list': '/api/cms/activity/interestGroup/list'
        }
      },
      '/api/cms/activity/interestGroup/info': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/activity/interestGroup/info': '/api/cms/activity/interestGroup/info'
        }
      },
      '/api/cms/activity/groupActlist': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/activity/groupActlist': '/api/cms/activity/groupActlist'
        }
      },
      '/api/cms/activity/queryActivityInfo': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/activity/queryActivityInfo': '/api/cms/activity/queryActivityInfo'
        }
      },
      '/api/cms/activity/joinGroup': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/activity/joinGroup': '/api/cms/activity/joinGroup'
        }
      },
      '/api/cms/activity/joinActivity': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/activity/joinActivity': '/api/cms/activity/joinActivity'
        }
      },
      '/api/cms/topics/query': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/topics/query': '/api/cms/topics/query'
        }
      },
      '/api/cms/home/viewpoints/add': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/home/viewpoints/add': '/api/cms/home/viewpoints/add'
        }
      },
      '/api/cms/home/viewpoints/query': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/home/viewpoints/query': '/api/cms/home/viewpoints/query'
        }
      },
      '/api/cms/home/viewpoints/doFavort': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/home/viewpoints/doFavort': '/api/cms/home/viewpoints/doFavort'
        }
      },
      '/api/cms/home/viewpoints/queryPointComment': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/home/viewpoints/queryPointComment': '/api/cms/home/viewpoints/queryPointComment'
        }
      },
      '/api/cms/home/viewpoints/addPointComment': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/home/viewpoints/addPointComment': '/api/cms/home/viewpoints/addPointComment'
        }
      },
      '/api/cms/home/viewpoints/info': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/home/viewpoints/info': '/api/cms/home/viewpoints/info'
        }
      },
      '/api/cms/home/topics/query': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/home/topics/query': '/api/cms/home/topics/query'
        }
      },
      '/api/cms/home/topics/queryCommit': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/home/topics/queryCommit': '/api/cms/home/topics/queryCommit'
        }
      },
      '/api/cms/home/topics/addComment': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/home/topics/addComment': '/api/cms/home/topics/addComment'
        }
      },
      '/api/cms/home/topics/info': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/home/topics/info': '/api/cms/home/topics/info'
        }
      },
      '/api/cms/market/categary': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/market/categary': '/api/cms/market/categary'
        }
      },
      '/api/cms/market/products/list': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/market/products/list': '/api/cms/market/products/list'
        }
      },
      '/api/cms/specialColumns/list': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/specialColumns/list': '/api/cms/specialColumns/list'
        }
      },
      '/api/cms/specialColumns/customer': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/specialColumns/customer': '/api/cms/specialColumns/customer'
        }
      },
      '/api/cms/specialColumns/contents': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/specialColumns/contents': '/api/cms/specialColumns/contents'
        }
      },
      '/api/cms/specialColumns/contentDetail': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/specialColumns/contentDetail': '/api/cms/specialColumns/contentDetail'
        }
      },
      '/api/cms/specialColumns/subscribe': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/specialColumns/subscribe': '/api/cms/specialColumns/subscribe'
        }
      },
      '/api/cms/specialColumns/unsubscribe': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/specialColumns/unsubscribe': '/api/cms/specialColumns/unsubscribe'
        }
      },
      '/api/cms/me/createInviteQrCode': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/me/createInviteQrCode': '/api/cms/me/createInviteQrCode'
        }
      },
      '/api/cms/comments/query': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/comments/query': '/api/cms/comments/query'
        }
      },
      '/api/cms/comments/queryMany': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/comments/queryMany': '/api/cms/comments/queryMany'
        }
      },
      '/api/cms/comments/add': {
        target: 'http://127.0.0.1:3000',
        changeOrigin: true,
        pathRewrite: {
          '^/api/cms/comments/add': '/api/cms/comments/add'
        }
      }
    },
    // CSS Sourcemaps off by default because relative paths are "buggy"
    // with this option, according to the CSS-Loader README
    // (https://github.com/webpack/css-loader#sourcemaps)
    // In our experience, they generally work as expected,
    // just be aware of this issue when enabling this option.
    cssSourceMap: false
  }
}
